/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function pullNews(proWinker){
 jQuery.ajax({
     type:'POST',
     url: Routing.generate('_recentNews', {'slugName' : proWinker}),
     dataType: 'json',
     timeout: 10000000000,
     success:function(response){
         console.log(response);
         if(response.data){
             jQuery(".recent-wink-container").prepend("<div class='element'>"+response.data[0].stores+"</div>");
         }
         
     },
     complete: function(){
         pullNews(proWinker);
     }
         
 })
}

jQuery(document).ready(function(){
    pullNews(jQuery(".recent-wink-container").attr("id"));
})